import Vue from 'vue'
import Vuex from 'vuex'
import mutations from './mutations';
import * as actions from './actions';
import * as getters from './getters';
import cookie from '../static/js/cookie';

Vue.use(Vuex);

const userInfo = {
    name: cookie.getCookie('name') || '',
    groups: cookie.getCookie('groups') || '',
    token: cookie.getCookie('token') || ''
};

const menusModule = {
    menus: [] || '',
    url: '/app/home/index' || ''
};

const state = {
    userInfo,
    menusModule
}

const store = new Vuex.Store({
    state,
    mutations,
    actions,
    getters,
})
export default store;
